home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / APW Interfaces / CInclude / Finder.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-04  |  16.1 KB  |  460 lines  |  [TEXT/MPS ]

  1. /********************************************
  2. ; File: Finder.h
  3. ;
  4. ; Copyright Apple Computer, Inc. 1991-92
  5. ; All Rights Reserved
  6. ;
  7. ********************************************/
  8. #ifndef __TYPES__
  9. #include <TYPES.h>
  10. #endif
  11.  
  12. #ifndef __QUICKDRAW__
  13. #include <QUICKDRAW.h>
  14. #endif
  15.  
  16. #ifndef __EVENT__
  17. #include <EVENT.h>
  18. #endif
  19.  
  20. #ifndef __WINDOW__
  21. #include <WINDOW.h>
  22. #endif
  23.  
  24. #ifndef __FINDER__
  25. #define __FINDER__
  26.  
  27. /* target name for SendRequest to Finder */
  28. #define NAME_OF_FINDER "\pApple~Finder~"
  29.  
  30. /* SendRequest codes sent by the Finder */
  31. #define finderSaysHello                 0x0100
  32. #define finderSaysGoodbye               0x0101
  33. #define finderSaysSelectionChanged      0x0102
  34. #define finderSaysMItemSelected         0x0103
  35. #define finderSaysBeforeOpen            0x0104
  36. #define finderSaysOpenFailed            0x0105
  37. #define finderSaysBeforeCopy            0x0106
  38. #define finderSaysIdle                  0x0107
  39. #define finderSaysExtrasChosen          0x0108
  40. #define finderSaysBeforeRename          0x0109
  41. #define finderSaysKeyHit                0x010A
  42.  
  43. /************************************************************************************************/
  44.  
  45. /* SendRequest codes sent to the Finder (target = "Apple~Finder~") */
  46. #define tellFinderGetDebugInfo          0x8000
  47. #define tellFinderAreYouThere           0x8001
  48. #define askFinderAreYouThere            0x8001
  49. #define tellFinderOpenWindow            0x8002
  50. #define tellFinderCloseWindow           0x8003
  51. #define tellFinderGetSelectedIcons      0x8004
  52. #define tellFinderSetSelectedIcons      0x8005
  53. #define tellFinderLaunchThis            0x8006
  54. #define tellFinderShutDown              0x8007
  55. #define tellFinderMItemSelected         0x8008
  56. #define tellFinderMatchFileToIcon       0x800A
  57. #define tellFinderAddBundle             0x800B
  58. #define tellFinderAboutChange           0x800C
  59. #define tellFinderCheckDatabase         0x800D
  60. #define tellFinderColorSelection        0x800E
  61. #define tellFinderAddToExtras           0x800F
  62. #define tellFinderIdleHowLong           0x8011
  63. #define askFinderIdleHowLong            0x8011
  64. #define tellFinderGetWindowIcons        0x8012
  65. #define tellFinderGetWindowInfo         0x8013
  66. #define tellFinderRemoveFromExtras      0x8014
  67. #define tellFinderSpecialPreferences    0x8015
  68.  
  69. /************************************************************************************************/
  70.  
  71. /* Finder menu item IDs */
  72. #define finderItemAbout 0x012D
  73. #define finderItemHelp 0x012E
  74. #define finderItemNewFolder 0x015F
  75. #define finderItemOpen 0x0160
  76. #define finderItemPrint 0x0161
  77. #define finderItemClose 0x0162
  78. #define finderItemCloseAll 0x0163
  79. #define finderItemDuplicate 0x0164
  80. #define finderItemPutAway 0x0165
  81. #define finderItemValidate 0x0166
  82. #define finderItemUndo 0x00FA
  83. #define finderItemCut 0x00FB
  84. #define finderItemCopy 0x00FC
  85. #define finderItemPaste 0x00FD
  86. #define finderItemClear 0x00FE
  87. #define finderItemSelectAll 0x0191
  88. #define finderItemShowClipboard 0x0192
  89. #define finderItemStackWindows 0x01C3
  90. #define finderItemByIcon 0x01F5
  91. #define finderItemBySmallIcon 0x01F6
  92. #define finderItemByName 0x01F7
  93. #define finderItemByDate 0x01F8
  94. #define finderItemBySize 0x01F9
  95. #define finderItemByKind 0x01FA
  96. #define finderItemFormat 0x0227
  97. #define finderItemErase 0x0228
  98. #define finderItemVerify 0x0229
  99. #define finderItemEject 0x022A
  100. #define finderItemCleanUp 0x0259
  101. #define finderItemEmptyTrash 0x025A
  102. #define finderItemPreferences 0x025B
  103. #define finderItemIconInfo 0x025C
  104. #define finderItemShutDown 0x025D
  105. #define finderItemCleanUpByName 0x025E
  106. #define finderItemColorBlack 0x028B
  107. #define finderItemColorBlue 0x028C
  108. #define finderItemColorYellowBrown 0x028D
  109. #define finderItemColorGray1 0x028E
  110. #define finderItemColorRed 0x028F
  111. #define finderItemColorPurple 0x0290
  112. #define finderItemColorOrange 0x0291
  113. #define finderItemColorPink 0x0292
  114. #define finderItemColorDarkGreen 0x0293
  115. #define finderItemColorAqua 0x0294
  116. #define finderItemColorBrightGreen 0x0295
  117. #define finderItemColorPaleGreen 0x0296
  118. #define finderItemColorPeriwinkleBlue 0x0298
  119. #define finderItemColorYellow 0x0299
  120. #define finderItemColorWhite 0x029A
  121.  
  122. /************************************************************************************************/
  123.  
  124. /* Finder SendRequest Result Error Codes */
  125. #define fErrNoError         0x0000    /* no error */
  126. #define fErrBadInput        0x4201    /* bad input value */
  127. #define fErrFailed          0x4202    /* could not complete request */
  128. #define fErrCancel          0x4203    /* user cancelled operation */
  129. #define fErrDimmed          0x4204    /* menu item was dimmed */
  130. #define fErrBusy            0x4205    /* not now, finder has headache */
  131. #define fErrNotPrudent      0x4206    /* can't add Finder's resources to desktop file */
  132. #define fErrBadBundle       0x4207    /* unknown rBundle version, or rBundle damaged */
  133. #define fErrNotImp          0x42FF    /* request not implemented */
  134.  
  135. /************************************************************************************************/
  136.  
  137. /* general Finder data structures */
  138.  
  139. typedef struct iconObj *iconObjPtr, **iconObjHandle;
  140. typedef struct iconObj {
  141.     iconObjHandle icNext;               /* next icon in list (NIL = no more) */
  142.     iconObjHandle icLast;               /* previous icon in list (NIL = no more) */
  143.     WindowPtr icMom;                    /* window the icon is currently in (NIL = desktop) */
  144.     WindowPtr icWind;                   /* window the icon is opened into */
  145.     iconObjHandle icDisk;               /* disk iconObj which owns this icon */
  146.     long icFlag;                        /* see below */
  147.     word icFType;                       /* icon's file type */
  148.     long icFileInfo;                    /* file's auxtype or disk's file system */
  149.     char *icKind;                       /* pointer to Kind pstring, or NIL */
  150.     word icy;                           /* vertical position of bottom of icon */
  151.     word icx;                           /* horizontal position of center of icon */
  152.     word icTextY;                       /* icon's vertical position when viewed by text */
  153.     word icTitleLen;                    /* half the width of the icon's title */
  154.     char icName[34];                    /* pstring name of icon */
  155.     word icLocalAccess;                 /* icon's current local access */
  156.     word icForked;                      /* bit 15 set if file is extended */
  157.     long icFBlocks;                     /* file's size in blocks, or number of used blocks on disk */
  158.     long icFBytes;                      /* file's size in bytes, or total blocks on disk */
  159.     TimeRec icCDate;                    /* create date/time */
  160.     TimeRec icMDate;                    /* last-modified date/time */
  161.     long icIcon;                        /* index into Finder's list of icon images */
  162.     long icSmallIcon;                   /* index into Finder's list of icon images */
  163.     Handle icRBundle;                   /* handle of rBundle which matched this icon, or NIL */
  164.     long icOneDocOffset;                /* offset to oneDoc within rBundle handle */
  165.     WindowPtr icInfo;                   /* pointer to Icon Info window, or NIL */
  166.     word icDevNum;                      /* device number (valid for disk/device icons) */
  167.     word icDevInfo;                     /* device characteristics (valid for disk/device icons) */
  168.     word icOptionList;                  /* beginning of option list--length */
  169.     word icFST;                         /* FST ID (first data word of option list) */
  170.     char bodyOfOptionList[36];          /* next 36 bytes of option list */
  171.     long icNetworkAccess;               /* access information if FST ID is $0D (AppleShare) */
  172.     } iconObj;
  173.  
  174. /* icFlag values */
  175.  
  176. #define ICSELECTED     0x00000001L
  177. #define ICOPENED       0x00000002L
  178. #define ICOFFLINE      0x00000004L
  179. #define ICEXTENDED     0x00000008L
  180. #define ICLOCKED       0x00000080L
  181. #define ICFORECLR      0x00000f00L
  182. #define ICBACKCLR      0x0000F000L
  183. #define ICNETACCESS    0x000F0000L
  184. #define ICNETWORK      0x01000000L
  185. #define ICREADABLE     0x02000000L
  186.  
  187. typedef struct finderWindBlk {
  188.     iconObjHandle windIcons;
  189.     word windID;
  190.     word windView;
  191.     iconObjHandle windIc;
  192.     iconObjHandle windDiskIc;
  193.     word windItems;
  194.     long windUsed;
  195.     long windFree;
  196.     word windFST;
  197.     word windAccess;
  198.     word windDirty;
  199.     char windTitle[54];
  200.     word windMenuItem;
  201.     char windMenuText[52];
  202.     TimeRec windDate;
  203.     char windPath[991];
  204.     } finderWindBlk, *finderWindBlkPtr;
  205.  
  206. /************************************************************************************************/
  207.  
  208. /* finderSays DataIn Structures */
  209.  
  210. typedef struct finderSaysHelloIn {
  211.     word pCount;
  212.     long versNum;
  213.     word finderUserID;
  214.     word iconObjectSize;
  215.     } finderSaysHelloIn, *finderSaysHelloInPtr;
  216.  
  217. typedef struct finderSaysMItemSelectedIn {
  218.     word pCount;
  219.     word menuItemID;
  220.     word menuID;
  221.     word modifiers;
  222.     } finderSaysMItemSelectedIn, *finderSaysMItemSelectedInPtr;
  223.  
  224. typedef struct finderSaysBeforeOpenIn {
  225.     word pCount;
  226.     pointer pathname;
  227.     RectPtr zoomRect;
  228.     word filetype;
  229.     long auxtype;
  230.     word modifiers;
  231.     iconObjHandle theIconObj;
  232.     word printFlag;
  233.     } finderSaysBeforeOpenIn, *finderSaysBeforeOpenInPtr,
  234.       finderSaysOpenFailedIn, *finderSaysOpenFailedInPtr;
  235.  
  236. typedef struct finderSaysBeforeCopyIn {
  237.     word pCount;
  238.     ptr sourcePathname;
  239.     ptr destinationPathname;
  240.     } finderSaysBeforeCopyIn, *finderSaysBeforeCopyInPtr;
  241.  
  242. typedef struct finderSaysBeforeRenameIn {
  243.     word pCount;
  244.     ptr oldPathname;
  245.     ptr newPathname;
  246.     word filetype;
  247.     long auxtype;
  248.     } finderSaysBeforeRenameIn, *finderSaysBeforeRenameInPtr;
  249.  
  250. typedef struct finderSaysKeyHitIn {
  251.     word pCount;
  252.     word message;
  253.     word modifiers;
  254.     } finderSaysKeyHitIn, *finderSaysKeyHitInPtr;
  255.  
  256. /************************************************************************************************/
  257.  
  258. /* finderSays DataOut Structures */
  259.  
  260. typedef struct finderSaysMItemSelectedOut {
  261.     word recvCount;
  262.     word abortItFlag;
  263.     } finderSaysMItemSelectedOut, *finderSaysMItemSelectedOutPtr;
  264.  
  265. typedef struct finderSaysBeforeCopyOut {
  266.     word recvCount;
  267.     word abortFlag;    /* 0 = continue, 1 = abort, 2 - $FFFF reserved */
  268.     } finderSaysBeforeCopyOut, *finderSaysBeforeCopyOutPtr;
  269.  
  270. typedef struct finderSaysBeforeRenameOut {
  271.     word recvCount;
  272.     word abortFlag;    /* boolean, non-zero to abort rename */
  273.     } finderSaysBeforeRenameOut, *finderSaysBeforeRenameOutPtr;
  274.  
  275.  
  276. /************************************************************************************************/
  277.  
  278. /* tellFinder DataIn Structures */
  279.  
  280. typedef struct tellFinderLaunchThisIn {
  281.     word launchprint;
  282.     ptr pathname;
  283.     } tellFinderLaunchThisIn, *tellFinderLaunchThisInPtr;
  284.  
  285. typedef struct tellFinderMItemSelectedIn {
  286.     word menuItemID;
  287.     word modifiers;
  288.     word flags;    /* bit 15 = hilite, all other bits reserved */
  289. } tellFinderMItemSelectedIn, *tellFinderMItemSelectedInPtr;
  290.  
  291. typedef struct tellFinderMatchFileToIconIn {
  292.     word pCount;               /* 11, minimum 10 */
  293.     word votingBits;
  294.     word whichMatch;           /* we want 1 or higher */
  295.     word filetype;
  296.     long auxtype;
  297.     ptr matchFilenamePtr;
  298.     ptr createFileInfoPtr;
  299.     ptr modFileInfoPtr;
  300.     word localAccess;
  301.     word flags;                /* bit 15 = extended file, all other bits reserved */
  302.     ptr optionListPtr;
  303.     long combinedEOF;          /* resource and data fork EOF */
  304.     } tellFinderMatchFileToIconIn, *tellFinderMatchFileToIconInPtr;
  305.  
  306. typedef struct tellFinderAddBundleIn {
  307.     word addHow;               /* bit 15 = to Desktop file, bit 14 = to memory */
  308.     ptr pathnamePtr;
  309.     ptr desktopPathnamePtr;
  310.     long rBundleID;            /* NIL if adding to memory only */
  311.     } tellFinderAddBundleIn, *tellFinderAddBundleInPtr;
  312.  
  313. typedef struct tellFinderCheckDatabaseIn {
  314.     word update;                  /* high bit set if update should take place if match found */
  315.     ptr updatePathnamePtr;        /* ptr to use for update, NIL if no update */
  316.     ptr rVersionPtr;              /* must lock this resource */
  317.     } tellFinderCheckDatabaseIn, *tellFinderCheckDatabaseInPtr;
  318.  
  319. typedef struct tellFinderSpecialPreferencesIn {
  320.     word pCount;                  /* minimum 1 */
  321.     word dragHDtoTrash;           /* 0=disallow, 1=allow */
  322.     } tellFinderSpecialPreferencesIn, *tellFinderSpecialPreferencesInPtr;
  323.  
  324. /************************************************************************************************/
  325.  
  326. /* tellFinder DataOut Structures */
  327.  
  328. typedef struct tellFinderGetDebugInfoOut {
  329.     word recvCount;
  330.     word finderResult;
  331.     word pCount;
  332.     word directPage;
  333.     handle deskIcon;
  334.     handle nameChainH;
  335.     pointer filetypeBlock;
  336.     pointer deviceBlock;
  337.     handle masterChainH;
  338.     handle rFPListHandle;
  339.     word rFPCount;
  340.     long reserved[64];
  341.     } tellFinderGetDebugInfoOut, *tellFinderGetDebugInfoOutPtr;
  342.  
  343. typedef struct tellFinderAreYouThereOut {
  344.     word recvCount;
  345.     word finderResult;
  346.     } tellFinderAreYouThereOut, *tellFinderAreYouThereOutPtr;
  347.  
  348. typedef struct tellFinderOpenWindowOut {
  349.     word recvCount;
  350.     word finderResult;
  351.     WindowPtr window;
  352.     } tellFinderOpenWindowOut, *tellFinderOpenWindowOutPtr;
  353.  
  354. typedef struct tellFinderCloseWindowOut {
  355.     word recvCount;
  356.     word finderResult;
  357.     } tellFinderCloseWindowOut, *tellFinderCloseWindowOutPtr;
  358.  
  359. typedef struct tellFinderGetSelectedIconsOut {
  360.     word recvCount;
  361.     word finderResult;
  362.     WindowPtr iconWindowPtr;
  363.     Handle stringListHandle;
  364.     } tellFinderGetSelectedIconsOut, *tellFinderGetSelectedIconsOutPtr;
  365.  
  366. typedef struct tellFinderSetSelectedIconsOut {
  367.     word recvCount;
  368.     word finderResult;
  369.     } tellFinderSetSelectedIconsOut, *tellFinderSetSelectedIconsOutPtr;
  370.  
  371. typedef struct tellFinderLaunchThisOut {
  372.     word recvCount;
  373.     word finderResult;
  374.     } tellFinderLaunchThisOut, *tellFinderLaunchThisOutPtr;
  375.  
  376. typedef struct tellFinderShutDownOut {
  377.     word recvCount;
  378.     word finderResult;
  379.     } tellFinderShutDownOut, *tellFinderShutDownOutPtr;
  380.  
  381. typedef struct tellFinderMItemSelectedOut {
  382.     word recvCount;
  383.     word finderResult;
  384.     } tellFinderMItemSelectedOut, *tellFinderMItemSelectedOutPtr;
  385.  
  386. typedef struct tellFinderMatchFileToIconOut {
  387.     word recvCount;
  388.     word finderResult;
  389.     long oneDocOffset;                  /* NIL if no match */
  390.     Handle rBundleHandle;               /* NIL if no match */
  391.     Handle smallIconHandle;             /* Never NIL */
  392.     Handle largeIconHandle;             /* Never NIL */
  393.     Handle rFInderPathHandle;           /* NIL if no one owns icon */
  394.     } tellFinderMatchFileToIconOut, *tellFinderMatchFileToIconOutPtr;
  395.  
  396. typedef struct tellFinderAddBundleOut {
  397.     word recvCount;
  398.     word finderResult;
  399.     } tellFinderAddBundleOut, *tellFinderAddBundleOutPtr;
  400.  
  401. typedef struct tellFinderAboutChangeOut {
  402.     word recvCount;
  403.     word finderResult;
  404.     } tellFinderAboutChangeOut, *tellFinderAboutChangeOutPtr;
  405.  
  406. typedef struct tellFinderCheckDatabaseOut {
  407.     word recvCount;
  408.     word finderResult;
  409.     word match;  /* 0 if no match found, non-zero if match found */
  410.     } tellFinderCheckDatabaseOut, *tellFinderCheckDatabaseOutPtr;
  411.  
  412. typedef struct tellFinderColorSelectionOut {
  413.     word recvCount;
  414.     word finderResult;
  415.     } tellFinderColorSelectionOut, *tellFinderColorSelectionOutPtr;
  416.  
  417. typedef struct tellFinderAddToExtrasOut {
  418.     word recvCount;
  419.     word finderResult;
  420.     word menuItemID;
  421.     word menuID;
  422.     } tellFinderAddToExtrasOut, *tellFinderAddToExtrasOutPtr;
  423.  
  424. typedef struct tellFinderIdleHowLongOut {
  425.     word recvCount;
  426.     word finderResult;
  427.     long tickCount;
  428.     } tellFinderIdleHowLongOut, *tellFinderIdleHowLongOutPtr;
  429.  
  430. typedef struct tellFinderGetWindowIconsOut {
  431.     word recvCount;
  432.     word finderResult;
  433.     Handle stringListHandle;
  434.     } tellFinderGetWindowIconsOut, *tellFinderGetWindowIconsOutPtr;
  435.  
  436. typedef struct tellFinderGetWindowInfoOut {
  437.     word recvCount;
  438.     word finderResult;
  439.     word windowType;
  440.     word windView;
  441.     word windFST;
  442.     char *windTitle;
  443.     ptr windPath;
  444.     long reserved1;
  445.     long reserved2;
  446.     } tellFinderGetWindowInfoOut, *tellFinderGetWindowInfoOutPtr;
  447.  
  448. typedef struct tellFinderRemoveFromExtrasOut {
  449.     word recvCount;
  450.     word finderResult;
  451.     } tellFinderRemoveFromExtrasOut, *tellFinderRemoveFromExtrasOutPtr;
  452.  
  453. typedef struct tellFinderSpecialPreferencesOut {
  454.     word recvCount;
  455.     word finderResult;
  456.     } tellFinderSpecialPreferencesOut, *tellFinderSpecialPreferencesOutPtr;
  457.  
  458.  
  459. #endif
  460.